/**
 * Copyright (C) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package xyz.geminiwen.skinsprite.resource;

import ohos.global.config.ConfigManager;
import ohos.global.configuration.Configuration;
import ohos.global.configuration.DeviceCapability;
import ohos.global.resource.*;
import ohos.global.resource.solidxml.Pattern;
import ohos.global.resource.solidxml.SolidXml;
import ohos.global.resource.solidxml.Theme;
import ohos.global.resource.solidxml.TypedAttribute;

import java.io.IOException;
import java.util.List;

public class CustomResourceManager extends ResourceManager {

    private final ResourceManager proxy;

    public CustomResourceManager(ResourceManager resourceManager) {
        this.proxy = resourceManager;
    }

    @Override
    public Resource getResource(int i) throws IOException, NotExistException {
        return proxy.getResource(i);
    }

    @Override
    public String getIdentifier(int i) throws IOException, NotExistException {
        return proxy.getIdentifier(i);
    }

    @Override
    public Element getElement(int i) throws IOException, NotExistException, WrongTypeException {
        return proxy.getElement(i);
    }

    @Override
    @Deprecated
    public Theme getTheme(int i) throws IOException, NotExistException, WrongTypeException {
        return proxy.getTheme(i);
    }

    @Override
    public SolidXml getSolidXml(int i) throws IOException, NotExistException, WrongTypeException {
        return new CustomSolidXml(proxy.getSolidXml(i));
    }

    @Override
    public RawFileEntry getRawFileEntry(String s) {
        return proxy.getRawFileEntry(s);
    }

    @Override
    public ConfigManager getConfigManager() {
        return proxy.getConfigManager();
    }

    @Override
    public String getMediaPath(int i) throws IOException, NotExistException, WrongTypeException {
        return proxy.getMediaPath(i);
    }

    @Override
    public Configuration getConfiguration() {
        return proxy.getConfiguration();
    }

    @Override
    public DeviceCapability getDeviceCapability() {
        return proxy.getDeviceCapability();
    }

    @Override
    public void updateConfiguration(Configuration configuration, DeviceCapability deviceCapability) {
        proxy.updateConfiguration(configuration, deviceCapability);
    }

    @Override
    public Pattern createPattern(List<TypedAttribute.AttrData> list) {
        return proxy.createPattern(list);
    }

    @Override
    public Theme createTheme(List<TypedAttribute.AttrData> list) {
        return proxy.createTheme(list);
    }
}
